// Copyright (C) 1953-2022 NUDT
// Verilog module name - tss_commandack_generate
// Version: V3.4.0.20220225
// Created:
//         by - fenglin 
////////////////////////////////////////////////////////////////////////////
// Description:
//         Command ack generate 
///////////////////////////////////////////////////////////////////////////

`timescale 1ns/1ps

module tss_commandack_generate
#(parameter INDEX_HCP = 20, 
            PORT_NUM = 21
)
    (
        i_clk,
        i_rst_n,          
        
        i_wr_ffi,
        iv_addr_ffi,
        iv_rdata_ffi,
        
        i_wr_dex,
        iv_addr_dex,
        iv_rdata_dex,
        
        i_wr_ctx,
        iv_addr_ctx,
        iv_rdata_ctx,
        
        i_wr_grm,
        iv_addr_grm,
        iv_rdata_grm,
        
        i_wr_pcb,
        iv_addr_pcb,
        iv_rdata_pcb,
        
        i_wr_flt,
        iv_addr_flt,
        iv_rdata_flt,
        
        i_wr_trl,
        iv_addr_trl,
        iv_rdata_trl,  

        i_wr_idc,
        iv_addr_idc,
        iv_rdata_idc, 

        i_wr_ist,
        iv_addr_ist,
        iv_rdata_ist,        
        
        i_wr_qgc,
        iv_addr_qgc,
        iv_rdata_qgc,
        
        i_wr_mac     ,
        iv_addr_mac  ,
        iv_rdata_mac ,  

        i_wr_tau        ,
        iv_addr_tau     ,
        iv_rdata_tau    ,         
        
        o_command_ack_wr,
        ov_command_ack          
    );

// I/O
// clk & rst
input                   i_clk;
input                   i_rst_n;
//from ffi_p8 
input        [PORT_NUM-1:0]           i_wr_ffi;
input        [PORT_NUM*19-1:0]     iv_addr_ffi;
input        [PORT_NUM*32-1:0]     iv_rdata_ffi;
//from dex_p8 
input        [PORT_NUM-1:0]           i_wr_dex;
input        [PORT_NUM*19-1:0]     iv_addr_dex;
input        [PORT_NUM*32-1:0]     iv_rdata_dex;
//from ctx_p8 
input        [PORT_NUM-1:0]           i_wr_ctx;
input        [PORT_NUM*19-1:0]     iv_addr_ctx;
input        [PORT_NUM*32-1:0]     iv_rdata_ctx;
//from grm 
input                   i_wr_grm;
input        [18:0]     iv_addr_grm;
input        [31:0]     iv_rdata_grm;
//from pcb 
input                   i_wr_pcb;
input        [18:0]     iv_addr_pcb;
input        [31:0]     iv_rdata_pcb;
//from flt 
input                   i_wr_flt;
input        [18:0]     iv_addr_flt;
input        [31:0]     iv_rdata_flt;
//from trl 
input                   i_wr_trl;
input        [18:0]     iv_addr_trl;
input        [31:0]     iv_rdata_trl;
//from idc 
input                   i_wr_idc;
input        [18:0]     iv_addr_idc;
input        [31:0]     iv_rdata_idc;
//from ist 
input                   i_wr_ist;
input        [18:0]     iv_addr_ist;
input        [31:0]     iv_rdata_ist;
//from qgc 
input        [(PORT_NUM-1)-1:0]           i_wr_qgc;
input        [(PORT_NUM-1)*19-1:0]     iv_addr_qgc;
input        [(PORT_NUM-1)*32-1:0]     iv_rdata_qgc;

input        [(PORT_NUM-1)-1:0]           i_wr_mac     ;
input        [(PORT_NUM-1)*19-1:0]     iv_addr_mac  ;
input        [(PORT_NUM-1)*32-1:0]     iv_rdata_mac ; 

input                   i_wr_tau        ;
input        [18:0]     iv_addr_tau     ;
input        [31:0]     iv_rdata_tau    ; 

output  reg             o_command_ack_wr;
output  reg  [63:0]     ov_command_ack; 
always @(posedge i_clk or negedge i_rst_n) begin
    if(i_rst_n == 1'b0)begin
        o_command_ack_wr     <= 1'b0;
        ov_command_ack       <= 64'b0;      
	end
    else begin
        ov_command_ack[63:62]       <= 2'h3;
        ov_command_ack[61:58]       <= 4'b0;//sw_id,end_id
        if(i_wr_ffi[INDEX_HCP] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'd0;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[INDEX_HCP*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[INDEX_HCP*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[INDEX_HCP] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'd1;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[INDEX_HCP*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[INDEX_HCP*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
        else if(i_wr_ctx[INDEX_HCP] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'd4;//mid
            ov_command_ack[50:32]       <=  iv_addr_ctx[INDEX_HCP*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ctx[INDEX_HCP*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end




        else if(i_wr_ffi[0] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'd8;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[0*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[0*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[0] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'd9;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[0*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[0*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[0] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[0*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[0*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[0] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'd15;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[0*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[0*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[0] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'd12;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[0*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[0*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
        else if(i_wr_ffi[1] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h10;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[1*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[1*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[1] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h11;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[1*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[1*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[1] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'h14;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[1*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[1*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[1] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h17;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[1*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[1*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[1] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h14;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[1*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[1*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
        else if(i_wr_ffi[2] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h18;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[2*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[2*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[2] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h19;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[2*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[2*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[2] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[2*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[2*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[2] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h1F;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[2*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[2*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[2] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h1C;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[2*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[2*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_ffi[3] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h20;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[3*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[3*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[3] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h21;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[3*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[3*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[3] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[3*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[3*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[3] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h27;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[3*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[3*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[3] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h24;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[3*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[3*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[4] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h28;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[4*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[4*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[4] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h29;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[4*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[4*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[4] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[4*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[4*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[4] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h2F;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[4*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[4*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[4] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h2C;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[4*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[4*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[5] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h30;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[5*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[5*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[5] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h31;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[5*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[5*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[5] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[5*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[5*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[5] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h37;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[5*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[5*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[5] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h34;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[5*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[5*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[6] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h38;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[6*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[6*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[6] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h39;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[6*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[6*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[6] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[6*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[6*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[6] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h3F;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[6*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[6*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[6] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h3C;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[6*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[6*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[7] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h40;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[7*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[7*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[7] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h41;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[7*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[7*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[7] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[7*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[7*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[7] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h47;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[7*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[7*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[7] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h44;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[7*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[7*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[8] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h48;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[8*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[8*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[8] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h49;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[8*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[8*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[8] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[8*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[8*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[8] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h4B;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[8*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[8*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[8] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h4A;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[8*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[8*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_ffi[9] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h4C;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[9*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[9*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[9] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h4D;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[9*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[9*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[9] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[9*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[9*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[9] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h4F;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[9*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[9*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[9] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h4E;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[9*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[9*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
        else if(i_wr_ffi[10] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h50;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[10*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[10*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[10] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h51;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[10*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[10*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[10] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[10*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[10*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[10] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h53;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[10*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[10*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[10] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h52;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[10*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[10*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_ffi[11] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h54;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[11*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[11*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[11] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h55;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[11*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[11*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
//        else if(i_wr_ctx[11] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ctx[11*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ctx[11*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
        else if(i_wr_mac[11] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h57;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[11*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[11*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[11] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h56;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[11*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[11*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[12] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h58;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[12*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[12*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[12] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h59;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[12*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[12*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[12] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[12*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[12*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[12] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h5B;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[12*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[12*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[12] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h5A;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[12*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[12*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[13] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h5C;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[13*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[13*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[13] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h5D;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[13*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[13*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[13] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[13*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[13*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[13] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h5F;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[13*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[13*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[13] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h5E;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[13*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[13*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_ffi[14] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h60;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[14*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[14*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[14] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h61;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[14*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[14*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[13] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[13*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[13*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[14] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h63;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[14*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[14*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[14] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h62;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[14*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[14*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_ffi[15] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h64;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[15*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[15*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[15] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h65;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[15*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[15*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[15] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[15*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[15*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[15] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h67;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[15*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[15*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[15] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h66;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[15*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[15*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_ffi[16] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h68;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[16*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[16*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[16] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h69;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[16*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[16*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[16] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[16*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[16*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[16] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h6B;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[16*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[16*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[16] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h6A;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[16*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[16*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[17] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h6C;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[17*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[17*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[17] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h6D;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[17*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[17*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[17] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[17*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[17*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[17] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h6F;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[17*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[17*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[17] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h6E;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[17*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[17*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end


        else if(i_wr_ffi[18] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h70;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[18*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[18*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[18] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h71;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[18*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[18*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[18] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[18*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[18*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[18] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h73;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[18*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[18*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[18] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h72;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[18*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[18*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_ffi[19] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h74;//mid
            ov_command_ack[50:32]       <=  iv_addr_ffi[19*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_ffi[19*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;            
        end        
        else if(i_wr_dex[19] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h75;//mid
            ov_command_ack[50:32]       <=  iv_addr_dex[19*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_dex[19*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end
 //       else if(i_wr_ctx[19] == 1'b1)begin
 //           ov_command_ack[57:51]       <= 7'd12;//mid
 //           ov_command_ack[50:32]       <=  iv_addr_ctx[19*19+:19];//maddr
 //           ov_command_ack[31:0]        <= iv_rdata_ctx[19*32+:32];//rd data
 //           o_command_ack_wr            <= 1'b1;           
 //       end
        else if(i_wr_mac[19] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h77;//mid
            ov_command_ack[50:32]       <=  iv_addr_mac[19*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_mac[19*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end        
        else if(i_wr_qgc[19] == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h76;//mid
            ov_command_ack[50:32]       <=  iv_addr_qgc[19*19+:19];//maddr
            ov_command_ack[31:0]        <= iv_rdata_qgc[19*32+:32];//rd data
            o_command_ack_wr            <= 1'b1;           
        end






        
        else if(i_wr_flt == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h78;//mid
            ov_command_ack[50:32]       <= iv_addr_flt;//maddr
            ov_command_ack[31:0]        <= iv_rdata_flt;//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_pcb == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h79;//mid
            ov_command_ack[50:32]       <= iv_addr_pcb;//maddr
            ov_command_ack[31:0]        <= iv_rdata_pcb;//rd data
            o_command_ack_wr            <= 1'b1;           
        end

        else if(i_wr_grm == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h7A;//mid
            ov_command_ack[50:32]       <= iv_addr_grm;//maddr
            ov_command_ack[31:0]        <= iv_rdata_grm;//rd data
            o_command_ack_wr            <= 1'b1;           
        end 

        else if(i_wr_trl == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h7B;//mid
            ov_command_ack[50:32]       <= iv_addr_trl;//maddr
            ov_command_ack[31:0]        <= iv_rdata_trl;//rd data
            o_command_ack_wr            <= 1'b1;           
        end
        else if(i_wr_idc == 1'b1)begin
            ov_command_ack[57:51]       <= 7'h7C;//mid
            ov_command_ack[50:32]       <= iv_addr_idc;//maddr
            ov_command_ack[31:0]        <= iv_rdata_idc;//rd data
            o_command_ack_wr            <= 1'b1;           
        end
        //else if(i_wr_ist == 1'b1)begin
        //    ov_command_ack[57:51]       <= 7'd125;//mid
        //    ov_command_ack[50:32]       <= iv_addr_ist;//maddr
        //    ov_command_ack[31:0]        <= iv_rdata_ist;//rd data
        //    o_command_ack_wr            <= 1'b1;           
        //end
        //else if(i_wr_tau == 1'b1)begin
        //    ov_command_ack[57:51]       <= 7'd126;//mid
        //    ov_command_ack[50:32]       <= iv_addr_tau;//maddr
        //    ov_command_ack[31:0]        <= iv_rdata_tau;//rd data
        //    o_command_ack_wr            <= 1'b1;           
        //end        
        else begin
            ov_command_ack              <= 64'b0;
            o_command_ack_wr            <= 1'b0;           
        end          
    end
end    


//        else if(i_wr_ffi[iii] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd8;//mid
//            ov_command_ack[50:32]       <=  iv_addr_ffi[iii*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_ffi[iii*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;            
//        end        
//        else if(i_wr_dex[iii] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd9;//mid
//            ov_command_ack[50:32]       <=  iv_addr_dex[iii*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_dex[iii*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
//        else if(i_wr_qgc[iii] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd12;//mid
//            ov_command_ack[50:32]       <=  iv_addr_qgc[iii*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_qgc[iii*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end
//        else if(i_wr_mac[iii] == 1'b1)begin
//            ov_command_ack[57:51]       <= 7'd15;//mid
//            ov_command_ack[50:32]       <=  iv_addr_mac[iii*19+:19];//maddr
//            ov_command_ack[31:0]        <= iv_rdata_mac[iii*32+:32];//rd data
//            o_command_ack_wr            <= 1'b1;           
//        end        


endmodule
